<template>
  <div>
    <el-menu class="nav" router mode="horizontal">
      <el-menu-item :route="{name:'Home'}" index="1">首页</el-menu-item>
      <el-menu-item :route="{name:'Student'}" index="2">学生信息</el-menu-item>
      <el-menu-item :route="{name:'Fraction'}" index="3">成绩信息</el-menu-item>
      <el-menu-item v-if="username" :route="{name:'Login'}" index="4">登录</el-menu-item>
    </el-menu>
  </div>
</template>
<script>
export default({
  data() {
    return {
      username:localStorage.getItem("usr"),
    }
  },
})
</script>